package com.erp.erp_servers.business.imp;

import com.erp.erp_dao.business.ICarryDetailCostDao;
import com.erp.erp_entitys.business.entity.CarryDetailCostEntity;
import com.erp.erp_servers.business.ICarryDetailCostService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName : CarryDetailCostServiceImp
 * @Description : 出运明细费用接口实现层
 * @Author : lst
 * @Date: 2021-01-07 20:53
 */
@Service
public class CarryDetailCostServiceImp implements ICarryDetailCostService {

    /**
     * 注入出运明细费用mapper
     */
    private final ICarryDetailCostDao carryDetailCostDao;

    @Autowired
    public CarryDetailCostServiceImp(ICarryDetailCostDao carryDetailCostDao) {
        this.carryDetailCostDao = carryDetailCostDao;
    }

    /**
     * 通过ID查询单条数据
     *
     * @param id 主键
     * @return 实例对象
     */
    @Override
    public CarryDetailCostEntity queryById(Integer id) {
        return carryDetailCostDao.queryById(id);
    }

    /**
     * 通过实体作为筛选条件查询
     *
     * @param carryDetailCost 实例对象
     * @return 对象列表
     */
    @Override
    public List<CarryDetailCostEntity> queryAll(CarryDetailCostEntity carryDetailCost) {
        return carryDetailCostDao.queryAll(carryDetailCost);
    }

    /**
     * 新增数据
     *
     * @param carryDetailCost 实例对象
     * @return 影响行数
     */
    @Override
    public int insert(CarryDetailCostEntity carryDetailCost) {
        return carryDetailCostDao.insert(carryDetailCost);
    }

    /**
     * 修改数据
     *
     * @param carryDetailCost 实例对象
     * @return 影响行数
     */
    @Override
    public int update(CarryDetailCostEntity carryDetailCost) {
        return carryDetailCostDao.update(carryDetailCost);
    }

    /**
     * 批量新增
     * @param list 新增对象集合
     * @return 影响行数
     */
    @Override
    public int addList(List<CarryDetailCostEntity> list) {
        return carryDetailCostDao.addList(list);
    }
}
